<!--<?php

//load library
include("../../config.php");

//connect db
Model::connect();

$sql="SELECT * FROM tbl_product WHERE `focus`=1 AND `image`<>''";
$res=mysql_query($sql) or Controller::dieN(mysql_error());
$image="";
if(mysql_num_rows($res)>0)
{
	$i=0;
	while($row=mysql_fetch_array($res))
	{
		$o_src='';
		$li_margin_right=($i%4==3?0:10);
		if($row["image"]=="")
		{	
			$src="images/productbrowser_noimage.jpg";
		}
		else
		{
			$src="_thumbs/images/product/$row[image]";
			/*if(!file_exists($src))
			{
				$o_src=$src;
				$src="images/productbrowser_noimage.jpg";
			}*/
		}
		$href="?zone=product&id=$row[id]";		
		$image.='
		<li style="margin-right:'.$li_margin_right.'px">
			<p class="image">
				<a href="'.$href.'">
					<img title="'.$o_src.'" src="'.$src.'" />
				</a>
			</p>
			<h3>'.$row['name'].'</h3>
			<p class="info">'.strip_tags($row['detail']).'</p>			
		</li>';	
		$i++;
	}
}

$sqlConfig="SELECT * FROM tbl_config WHERE `key`='banner'";
$resConfig=mysql_query($sqlConfig) ;
$rowConfig=mysql_fetch_array($resConfig);
?>-->

<style>
#container img{width:100%;}
#container{	
		margin:0 auto;
		width:986px;
		text-align:left;
		position:relative;
		padding:0px 2px;
		}
		
	ul#items{		
		margin:1em 0;
		width:auto;
		height:245px;
		overflow:hidden;
		}
	ul#items li{
		width:239px;
		list-style:none;
		float:left;
		height:240px;
		overflow:hidden;
		background:white;
		color:#fff;
		text-align:center;
		-moz-border-radius:5px;
		-webkit-border-radius:5px;
		border-radius:5px;
		-moz-box-shadow:0 1px 1px #777;
		-webkit-box-shadow:0 1px 1px #777;
		box-shadow:0 1px 1px #777;
		color:#555;
		}
	ul#items li:hover{color:#333;}
	ul#items li .image{
		
		width:100%;
		height:100%;
		margin:0px;
		overflow:hidden;
		}	
	ul#items h3{text-transform:uppercase;font-size:14px;font-weight:bold;margin:-42px 0 0px 0;width:100%;height:20px;overflow:hidden;opacity:0.8;padding:2px 4px 0px 4px;background-color:#2a4876;color:white}	
	ul#items .info{color:#777;text-shadow:#f1f1f1 0 1px 0;height:18px;overflow:hidden;width:100%;margin:0px;padding:0px 4px}	
	ol#pagination{position:relative;text-align:center;}
	ol#pagination li{
		display:inline-block;
		width:16px;
		height:16px;
		background:url(modules/js/easypaginate/images/bg_buttons.png) no-repeat 0 0;
		text-align:left;
		text-indent:-8000px;
		list-style:none;
		cursor:pointer;
		margin:0 2px;
		}
	ol#pagination li:hover{background:url(modules/js/easypaginate/images/bg_buttons.png) no-repeat 0 -16px;}
	ol#pagination li.current{color:#f00;font-weight:bold;background:url(modules/js/easypaginate/images/bg_buttons.png) no-repeat 0 -32px;}
	ol#pagination li.prev, ol#pagination li.next{
		position:absolute;
		top:-150px;
		}
	ol#pagination li.prev{left:-58px;background:url(modules/js/easypaginate/images/bg_buttons.png) no-repeat 0 -64px;}
	ol#pagination li.next{right:-30px;background:url(modules/js/easypaginate/images/bg_buttons.png) no-repeat 0 -48px;}
	
	.marquee0 {width:990px;}
</style>

<script type="text/javascript" src="modules/js/easypaginate/js/easypaginate.js"></script>
<script type="text/javascript">
jQuery(function($){
	var sec=5000;
	var slide=true;
	$('ul#items').easyPaginate({
		step:4
	});
	$('#container,#pagination').mouseenter(function(){
		slide=false;
	});
	$('#container,#pagination').mouseleave(function(){
		slide=true;
	});
	function autoSlide()
	{
		if($('#pagination .current').index()<$('#pagination .next').index()-1)
		{
			if(slide)
				$('#pagination .next').trigger('click');
			setTimeout(autoSlide,sec);
		}
		else
		{
			resetSlide();
		}
	}
	function resetSlide()
	{
		if(slide)
			$('#pagination li').eq(1).trigger('click');
		setTimeout(autoSlide,sec);
	}
	setTimeout(autoSlide,sec);
});    
</script>

<script type="text/javascript">
marqueeInit({
	uniqueid: 'mycrawler',
	style: {
		'padding': '5px',
		'width': '990px',
		'background': 'transparent',
		'border': '0px solid',
		'color':'#027792',
		'font-style':'italic'
	},
	inc: 4, //speed - pixel increment for each iteration of this marquee's movement
	mouse: 'cursor driven', //mouseover behavior ('pause' 'cursor driven' or false)
	moveatleast: 2,
	neutral: 150,
	savedirection: true
});
</script>

<div style='cursor:pointer' title='Cảm ơn quí khách đã vào trang web công ty Phú Trung Hoa. Nhấn vào để liên hệ ngay với chúng tôi.' onclick="window.location='?zone=contact'">
	<div class="marquee" id="mycrawler" ><?php echo $rowConfig['content'];?></div>
</div>

<div id="container">
	<ul id="items">
		<?php echo $image;?>
	</ul>
</div>




